import 'package:flutter_kit_dsp/flutter_kit_dsp.dart';
import 'package:get/get.dart';

class MyEdController extends EqController {
  RxInt currentPage = 0.obs;
  RxInt typeIndex = 10.obs;
  RxList<String> get btnTypes {
    return [
      globalController.byPassStatus.value == EQBypassStatus.restore ? 'RESTORE' : 'BYPASS',
      'RESET CH',
      'RESET ALL'
    ].obs;
  }

  late final RxList<GroupModel> groupList;
  @override
  void onInit() {
    super.onInit();
    final list = globalController.rxModel.value.ch_list;
    groupList = List.generate((list.length / 2).toInt(), (index) {
      final model = GroupModel(ch1: list[2 * index], ch2: list[2 * index + 1]);
      model.select = model.ch1!.select && model.ch2!.select;
      return model;
    }).obs;
  }
}
